package com.djf.flinkcdc.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Flink CDC 配置属性
 */
@Data
@Component
@ConfigurationProperties(prefix = "flink.cdc")
public class FlinkCdcProperties {

    private MySQL mysql = new MySQL();
    private Checkpoint checkpoint = new Checkpoint();

    @Data
    public static class MySQL {
        private String hostname = "127.0.0.1";
        private Integer port = 3306;
        private String username = "root";
        private String password = "root123";
        private String databaseList = "sharding_order_db";
        private String tableList = "sharding_order_db.t_order_.*,sharding_order_db.user_delivery_.*";
        private String startupMode = "initial";
        private String serverId = "5400-5404";
        private String serverTimeZone = "Asia/Shanghai";
    }

    @Data
    public static class Checkpoint {
        private Boolean enabled = true;
        private Long interval = 5000L;
        private String storage = "file:///tmp/flink-checkpoints";
    }
}